<div id="accordion2" class="accordion">
    <?php
    $sql = "SELECT * FROM safety
    WHERE status='1'
	and saf_tipo = 'ADVISORIES'
    ORDER BY saf_data DESC";
    $res = sql($sql);
    $i = 0;
    while($linha = mysql_fetch_array($res)){
        if ($i == 0){ $in = "in"; } else { $in = ""; }
    ?>
    <div class="accordion-group">
      <div class="accordion-heading">
        <a href="#<?php echo $linha['saf_id'];?>" data-parent="#<?php echo $linha['saf_id'];?>" data-toggle="collapse" class="accordion-toggle">
            <?php echo $linha['saf_nome']."&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;".  toDataBr($linha['saf_data']); ?>
        </a>
      </div>
      <div class="accordion-body collapse <?php echo $in; ?>" id="<?php echo $linha['saf_id'];?>">
        <div class="accordion-inner">
          <?php 
          if ($linha['saf_msg'] != "") { echo "<p>".nl2br($linha['saf_msg'])."</p>"; }
          if ($linha['saf_url'] != "") { echo "<p><i class='icon-file'></i> <a href='".$_SESSION['pro_site'].$linha['saf_url']."' target='_blank'>{$linha['saf_url']}</a></p>"; }
          ?>
        </div>
      </div>
    </div>
    <?php 
        $i++;
    } 
    ?> 
  </div>